from django.conf.urls import url
from . import views

urlpatterns = [
    # 注册
    url(r'^register/$', views.RegisterView.as_view()),
    # 判断用户名是否重复 /usernames/(?P<username>[a-zA-Z0-9_-]{5,20})/count/
    url(r'^usernames/(?P<username>[a-zA-Z0-9_-]{5,20})/count/$',views.UsernameCountView.as_view()),
    # 判断手机号是否重复  /mobiles/(?P<mobile>1[3-9]\d{9})/count/
    url(r'^mobiles/(?P<mobile>1[3-9]\d{9})/count/$', views.MobileCountView.as_view()),
    # 登录显示
    url(r'^login/$', views.LoginView.as_view()),
    # 退出登录
    url(r'^logout/$', views.LogoutView.as_view()),
    # 用户中心
    url(r'^info/$', views.UserInfoView.as_view(), name='info'),
    # 新增邮箱
    url(r'^emails/$', views.EmailView.as_view(), name='emails'),
    # 激活邮箱  /emails/verification/
    url(r'^emails/verification/$', views.VerifyEmailView.as_view()),
    # 收货地址显示 address/
    url(r'^address/$', views.AddressView.as_view(), name='address'),
    # 新增收货地址 addresses/create/
    url(r'^addresses/create/$', views.CreateAddressView.as_view()),
    # 11.修改密码
    url(r'^password/$', views.ChangePasswordView.as_view(), name='password'),
    # 12.保存用户浏览记录 browse_histories/
    url(r'^browse_histories//$', views.UserBrowseHistory.as_view()),
    # 13.显示忘记密码页　find_password/
    url(r'^find_password/$', views.FindPasswordView.as_view()),
    # 14.忘记密码第一步　accounts/(?P<username>[a-zA-Z0-9_-]{5,20})/sms/token/
    url(r'^accounts/(?P<username>[a-zA-Z0-9_-]{5,20})/sms/token/$', views.FindFirstView.as_view()),
    # 15.忘记密码发送短信　find_password_sms_codes/(?P<mobile>1[3-9]\d{9})/
    url(r'^find_password_sms_codes/(?P<mobile>1[3-9]\d{9})/$', views.FindPasswordSendSmsCodeView.as_view()),
    # 16.忘记密码第二步　accounts/(?P<mobile>[a-zA-Z0-9_-]{5,20})/password/token/
    url(r'^accounts/(?P<mobile>[a-zA-Z0-9_-]{5,20})/password/token/$', views.FindSecondView.as_view()),
    # 17.忘记密码提交 users/(?P<user_id>\d+)/new_password/
    url(r'^users/(?P<user_id>\d+)/new_password/$', views.UserNewPasswordView.as_view()),
]